package com.just.springboot;

import com.just.springboot.config.AuthorSettings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class SpringbootApplication {
    @Value("${book.author}")
    private String author;
    @Value("${book.name}")
    private String name;

    @Autowired
    private AuthorSettings authorSettings;

    public static void main(String[] args) {
       SpringApplication.run(SpringbootApplication.class, args);
       //设置不使用banner，这里的设置跟springboot版本有关系，具体设置看情况
        /*

         * Banner.Mode.OFF:关闭;

         * Banner.Mode.CONSOLE:控制台输出，默认方式;

         * Banner.Mode.LOG:日志输出方式;

         */
//        SpringApplication app=new SpringApplication(SpringbootApplication.class);
//        app.setBannerMode(Banner.Mode.OFF);
//        app.run(args);
    }
    @RequestMapping("/")
    public Object index(){
        //return "demo spring boot"+"  author:"+author+" | name:"+name;
        return authorSettings;
    }
}
